import core from 'gapi/core'

class searchPage extends core{
    /**
     * 获取搜索字段
     */
    searchKey (callBack){
        this.sendData({
            method: 'searchKey',
            param: {},
            callBack: callBack
        })
    }
      /**
     * 项目搜索
     * @method updateProjectList 
     * @public
     * @param {String Array}  searchColumns : 可搜索字段
     * @param {JSON searchData}  searchData :  搜索数据
     * @param {Number status} tab状态  1:进行中 2 已结束
     * @return {Object}
     * @example
     *        searchPage.updateProjectList(['name'], data, 1 => {
     *
     * 	    }
     * @since 1.0.0
     */
    updateProjectList (searchColumns, searchData, status, callBack){
		this.sendData({
			method: 'updateProjectList',
            param: {
                searchColumns: searchColumns,
                searchData: searchData,
                status: status
            },
			callBack: callBack
		});
	}
    /**
     * 成员搜索
     * @method updateMemberList
     * @public
     * @param {String Array}  searchColumns : 可搜索字段
     * @param {JSON searchData}  searchData :  搜索数据
     * @param {String projectId}  projectId: 项目ID
     * @return {Object}
     * @example
     *        searchPage.updateMemberList(['name', 'mobile', 'name_pinyin'], data, '111' ,=> {
     *
     * 	    }
     * @since 1.0.0
     */
    updateMemberList (searchColumns, searchData, projectId, callBack){
		this.sendData({
			method: 'updateMemberList',
            param: {
                searchColumns: searchColumns,
                searchData: searchData,
                projectId: projectId
            },
			callBack: callBack
		})
	}
    //设置搜索框高度距离顶部的高度,通知客户端
    setSearchBarOffset (offset,callBack) {
        this.sendData({
			method: 'setSearchBarOffset',
            param: {
                height: offset
            },
            callBack: callBack
		})
    }

}

export default new searchPage({
    // api的名字，可为任意名称
    name: 'searchPage api',
    // 作者
    author: 'huochunyang1@doumi.com',
    // 版本
    version: '2.0',
    // 默认，不用改动
    jsbc: jsBridgeClient,
    // nativeCls 一定要和客户端的同学对应
    nativeCls: 'searchPage'
})
